<?php

namespace App\Controller\InsideService;

class MailInside extends BaseInside {
    /**
     * 获取配置列表
     * @param string $size
     * @param string $game_hash
     * @param int $page
     * @return array
     */
    public function index(string $size = '', string $game_hash = '', int $page = 1): array {
        return $this->getInfo('Mail/index', [
            'page'      => $page,
            'size'      => $size,
            'game_hash' => $game_hash
        ]);
    }

    /**
     * 获取配置列表
     * @param string $id
     * @param string $status
     * @param string $game_hash
     * @return array
     */
    public function changeStatus(string $id = '', string $status = '', string $game_hash = ''): array {
        return $this->getInfo('Mail/changeStatus', [
            'id'        => $id,
            'status'    => $status,
            'game_hash' => $game_hash
        ]);
    }

    /**
     * 获取配置列表
     * @param string $size
     * @param string $mail_id
     * @param string $openid
     * @param int $page
     * @param string $game_hash
     * @return array
     */
    public function log(string $size = '', string $mail_id = '', string $openid = '', int $page = 1, string $game_hash = ''): array {
        return $this->getInfo('Mail/log', [
            'page'      => $page,
            'size'      => $size,
            'mail_id'   => $mail_id,
            'openid'    => $openid,
            'game_hash' => $game_hash
        ]);
    }

    /**
     * 新增配置表
     * @param $data
     * @return mixed
     */
    public function add($data): mixed {
        return $this->postInfo('Mail/add', $data);
    }

    /**
     * 描述: 获取玩家邮箱列表
     * 日期: 2023/3/9 17:48
     * @param array $data
     * @return array
     * @author: cinder
     */
    public function mailList(array $data): array {
        return $this->postInfo('Mail/mailList', $data);
    }
}